home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
XCMD libraries 960603
/
dummyXCMD.cp
< prev
next >
Wrap
Text File
|
1995-12-27
|
1KB
|
54 lines
#include "doXCMDPlusPlus.h"
#include "xcmdWind.h"
//•••••••
// Do our business
//•••••••
void
doXCMDPlusPlus( XCmdPtr paramPtr )
{
xcmdWindow xWind( paramPtr );
xWind.returnNil(); // assume no problems. (perhaps a bad name, it doesn't return,
// it just sets the return value to nil.)
try {
if ( xWind.isWindowEvent() ) { // with xWindow objects always ask this question first.
xWind.doWindowEvent();
}
else { // otherwise process as a command.
xcmdString param( xWind[0] );
if ( param == "OPEN" ) {
Rect theRect = {10,10,50,90};
xcmdString title( "Useless Window" );
CWindowPtr cw =
xWind.createWindow( theRect, title, 0 );
if ( cw == nil ) throw xcmdString( "Out of Memory, cannot create window." );
}
else
if ( param == "!" ) {
xWind.returnMsg( "My wicked xcmd! ©Paul B. Beeken, Knowledge Software Consulting." );
}
else
if ( param == "?" ) {
xWind.returnMsg( "dummyXCMD Open" );
}
else throw xcmdString( "Bad command: " ) & param;
} // else
} // try block
catch ( xcmdString s ) {
xWind.errorMsg( s );
}
}